package org.gd.hellojavacore;

import java.util.Arrays;

public class HashCodeExample {

    public static void main(String...str) {
        int h = 0;
        Object k = new Object();

        h ^= k.hashCode();
        System.out.println(k.hashCode());
        System.out.println(h);

        System.out.println(h | h);

        System.out.println(h>>1);
        System.out.println(h>>>1);

        // This function ensures that hashCodes that differ only by
        // constant multiples at each bit position have a bounded
        // number of collisions (approximately 8 at default load factor).
        h ^= (h >>> 20) ^ (h >>> 12);

        System.out.println(h);
        System.out.println((h >>> 7));
        System.out.println((h >>> 4));
        System.out.println(h ^ (h >>> 7) ^ (h >>> 4));

        System.out.println("==========================================");

        System.out.println(Arrays.toString("1234".getBytes()));

        int i=~-1^2;
        System.out.println(i);


    }
}
